#ifndef GRADIENTCIRCLESTRATEGY_H
#define GRADIENTCIRCLESTRATEGY_H

#pragma once

#include "../../ToolkitLayer.h"
#include <LDF/VisComponentStrategy.h>

/**
 * This strategy draws a circle with a gradient effect.
 *
 * @author Fabricio Anastacio - fabriciocfa@yahoo.com
 * @since September 25, 2007
 */
class TOOLKITLAYER_API GradientCircleStrategy : public VisComponentStrategy
{
	// Attributes
protected:
	/** The identifier of the display list that draws the circle. */
	unsigned int dlCircle;
	/** The color of this circle in RGBA. */
	unsigned char color[4];


	// Methods
public:
	/**
	 * Constructs a gradient circle strategy.
	 */
	GradientCircleStrategy(unsigned char r = 255, unsigned char g = 255,
		unsigned char b = 255, unsigned char a = 255);
	/**
	 * Destroys this strategy.
	 */
	~GradientCircleStrategy(void);


	// ACCESSOR METHODS
	/**
	 * Returns the color of this circle.
	 *
	 * @return the color of this circle.
	 */
	inline unsigned char* getColor() { return color; };
	/**
	 * Sets the color of this circle.
	 *
	 * @param r the red component of the color to be set
	 * @param g the green component of the color to be set
	 * @param b the blue component of the color to be set
	 * @param a the alpha component of the color to be set
	 */
	inline void setColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a = 255) {
		color[0] = r; color[1] = g; color[2] = b; color[3] = a;
	};

protected:
	/**
	 * Constructs the display list for drawing a circle with gradient.
	 */
	void createDisplayList();

	/**
	 * Defines the drawing strategy for the associated component.
	 *
	 * @param selectedIds the list of currently selected ids.
	 */
	void draw(const std::vector<unsigned long>& selectedIds);
};

#endif // GRADIENTCIRCLESTRATEGY_H
